Dynomotion

Group: DynoMotion Message: 11543 From: cnc_machines Date: 5/20/2015
Subject: Encoder Issue
Greetings,

I have 3 single ended optical encoders plugged into the ethernet port on my KFlop board going through about 2 feed of CAT5 cable. Everything seems to work okay except for one encoder which has an index. I am using the index to home the encoder.

    Jog(2,-1500);                     // jog slowly positive
    while (!ReadBit(42)) ;          // loop until IO bit goes high
    Jog(2,0);                            // stop

The issue is no matter what I do I cannot get bit 42 to stay low. I put a jumper to ground on pin 42 with the encoder unplugged the jog loop stops at random times. I am not sure what is going on could I be getting voltage leaking from the A and B channels of the same encoder forcing 42 high even with a jumper to negative?

I plugged the wire into another IO not going through the CAT5 and it seems to work. I cant understand why the A and B channels seem to work on the other encoders, but the index gives me random problems on this one? Can anyone help me figure out what is going on?

Thanks!

Scott
Group: DynoMotion Message: 11544 From: Hardy Family Date: 5/20/2015
Subject: Re: Encoder Issue
Couple of possibilities:


The RJ45 jack has no ground reference of its own, so make sure that there is some other common (ground) connection between the kflop and your encoders.

Have you checked with the Kmotion application (I/O panel)?  With no movement, you should see a steady level on bit 42.

Regards,
SJH


On Wed, May 20, 2015 at 3:35 PM, cnc_machines@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Greetings,

I have 3 single ended optical encoders plugged into the ethernet port on my KFlop board going through about 2 feed of CAT5 cable. Everything seems to work okay except for one encoder which has an index. I am using the index to home the encoder.

    Jog(2,-1500);                     // jog slowly positive
    while (!ReadBit(42)) ;          // loop until IO bit goes high
    Jog(2,0);                            // stop

The issue is no matter what I do I cannot get bit 42 to stay low. I put a jumper to ground on pin 42 with the encoder unplugged the jog loop stops at random times. I am not sure what is going on could I be getting voltage leaking from the A and B channels of the same encoder forcing 42 high even with a jumper to negative?

I plugged the wire into another IO not going through the CAT5 and it seems to work. I cant understand why the A and B channels seem to work on the other encoders, but the index gives me random problems on this one? Can anyone help me figure out what is going on?

Thanks!

Scott


Group: DynoMotion Message: 11546 From: cnc_machines Date: 5/21/2015
Subject: Re: Encoder Issue
Thanks for the suggestions. I am using the same 5V power supply to run my encoders and the Kflop board.

To do a test I have a new KFlop board sitting on my desk. I plugged a CAT5 cable in and am seeing very strange behavior.

When I connect Pin 8 (IO 43) directly to the 5V+ the digital IO screen has both IO 43 AND 42 come high. With the cable not connected to anything, when I flex it all of the IO 36-43 flash on and off completely randomly.

I think I am picking up one of these random signals while trying to find my index. I am very concerned that if my encoders are getting random noise I might get following errors on the A and B inputs that appear to be working.

Tom,

Can you help me here? Do these pins not have pull down resistors to hold them at zero unless they get a full 5V signal?

Thanks,

Scott
Group: DynoMotion Message: 11547 From: Hardy Family Date: 5/21/2015
Subject: Re: Encoder Issue
Note that if you are using a standard cat5 cable, then the pairs are wired to pins 1,2; 3,6; 4,5; 7,8.  This is not optimum for the way the rj45 is assigned to kflop encoder phases, which expect 1,2; 3,4; 5,6; 7,8.  It would be splitting pairs so that noise would be coupled to the adjacent encoder.  Tom could clarify, but I don't think the rj45 has strong pull-downs, which explains the noise on unconnected inputs that you see when flexing the cable (triboelectric effect, or just AC noise pickup).  If you tie all unused inputs to ground, then the noise problem should disappear.  If the cable is long, then you probably want to make one up with the pairs assigned correctly.  Obviously, the index pulse is an odd case, so ground the unused member of the pair, at just one end of the cable.

Regards,
SJH


On Thu, May 21, 2015 at 7:59 AM, cnc_machines@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Thanks for the suggestions. I am using the same 5V power supply to run my encoders and the Kflop board.

To do a test I have a new KFlop board sitting on my desk. I plugged a CAT5 cable in and am seeing very strange behavior.

When I connect Pin 8 (IO 43) directly to the 5V+ the digital IO screen has both IO 43 AND 42 come high. With the cable not connected to anything, when I flex it all of the IO 36-43 flash on and off completely randomly.

I think I am picking up one of these random signals while trying to find my index. I am very concerned that if my encoders are getting random noise I might get following errors on the A and B inputs that appear to be working.

Tom,

Can you help me here? Do these pins not have pull down resistors to hold them at zero unless they get a full 5V signal?

Thanks,

Scott


Group: DynoMotion Message: 11548 From: Tom Kerekes Date: 5/21/2015
Subject: Re: Encoder Issue
Hi Scott,

That all sounds like perfectly correct behavior.  The JP5 inputs are very high input impedance (many megohms) with no pull down resistance.  You must drive the signals for them to have any validity.  They are 3.3V inputs diode clamped to the 3.3V power rail.  There is a series resistance to avoid damage if shorted to the +5V.  But they shouldn't be driven higher than 3.8V.  5V TTL Outputs are only required to drive above 2.8V.  Most will not drive hard above 3.8V.  Because of the way the I/O is designed in pairs, if driven above 3.8V some clamping current will leak to the opposite input.

SJH makes good points.  The majority of RJ45 cables are not straight through so make sure you are really connected to the right pins.  I don't think the pairing of the wires in the cable is of any use.  All of the signals are single ended anyway.  So pairing one signal with another is not likely to be any better or worse than any other. 

With regard to noise pickup on I/O 42: KFLOP's inputs are very fast and can easily detect nanosecond spikes.  A Ceramic Capacitor with very short leads (several inches) connected very near KFLOP between the input and KFLOP GND can usually filter out spikes.  The right size will be needed to filter noise but not filter the pulse itself.  It depends some on the thing driving the signal but 0.001uF might be a good value to start with.  An Index pulse needs to be at least 180us to be reliably detected by a KFLOP User Program so there is large ratio between a real pulse and a noise spike.

I don't understand why the input was detected while it was jumper-ed to GND.   Are you sure you were on the right pin?  Were the wires long?

Here is a simple program to watch for glitches:

#include "KMotionDef.h"

// Simple check for Glitch on Input Pin

main()
{
    while (!ReadBit(42)) ;  // tight loop while input is low
    printf("Input was high!!\n");
}


HTH
Regards
TK

Group: DynoMotion Message: 11549 From: Hardy Family Date: 5/21/2015
Subject: Re: Encoder Issue
It's true that with single ended it should not matter which wire is used, but considering that each encoder (A and B output) will be referenced to the same ground (common at the encoder), it would be best to have the A,B on the same pair, so that ground differentials between different encoders do not cross-couple as strongly.  I think using single-ended without single-point ground wiring is always a worry.

You got me slightly concerned about the 5V tolerant inputs, though.  My design drives those rj45 inputs directly from a 26C32 style differential receiver.  The cmos part is running from 5V, and that will drive the outputs pretty close to 5V.  I haven't had any noticeable problems, but I would probably want to use 3.3V cmos in the future (if I can even find a diff receiver like that, with the usual +/-12V tolerance on the inputs).

Regards,
SJH


On Thu, May 21, 2015 at 9:09 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Scott,

That all sounds like perfectly correct behavior.  The JP5 inputs are very high input impedance (many megohms) with no pull down resistance.  You must drive the signals for them to have any validity.  They are 3.3V inputs diode clamped to the 3.3V power rail.  There is a series resistance to avoid damage if shorted to the +5V.  But they shouldn't be driven higher than 3.8V.  5V TTL Outputs are only required to drive above 2.8V.  Most will not drive hard above 3.8V.  Because of the way the I/O is designed in pairs, if driven above 3.8V some clamping current will leak to the opposite input.

SJH makes good points.  The majority of RJ45 cables are not straight through so make sure you are really connected to the right pins.  I don't think the pairing of the wires in the cable is of any use.  All of the signals are single ended anyway.  So pairing one signal with another is not likely to be any better or worse than any other. 

With regard to noise pickup on I/O 42: KFLOP's inputs are very fast and can easily detect nanosecond spikes.  A Ceramic Capacitor with very short leads (several inches) connected very near KFLOP between the input and KFLOP GND can usually filter out spikes.  The right size will be needed to filter noise but not filter the pulse itself.  It depends some on the thing driving the signal but 0.001uF might be a good value to start with.  An Index pulse needs to be at least 180us to be reliably detected by a KFLOP User Program so there is large ratio between a real pulse and a noise spike.

I don't understand why the input was detected while it was jumper-ed to GND.   Are you sure you were on the right pin?  Were the wires long?

Here is a simple program to watch for glitches:

#include "KMotionDef.h"

// Simple check for Glitch on Input Pin

main()
{
    while (!ReadBit(42)) ;  // tight loop while input is low
    printf("Input was high!!\n");
}


HTH
Regards
TK

Group: DynoMotion Message: 11551 From: cnc_machines Date: 5/21/2015
Subject: Re: Encoder Issue
Tom,

I have plugged the pin into one of the 3.3V inputs on the KFLOP(35) and it seems to work perfectly without any issues. Is there a difference between these pins? Do they have pull down resistors or something?

I may try using the capacitor as well. I am certain I was plugged into the correct pin, I checked with a meter.

Thanks,

Scott
Group: DynoMotion Message: 11553 From: Tom Kerekes Date: 5/21/2015
Subject: Re: Encoder Issue
Hi SJH,

The AM26L32A is what we use on Kanalog.  It won't source much current above 3.8V is any.  I think both the AM26L32A and AMC26 both have +/-7V common mode range

 
Regards
TK